package dmwr;

import dmwr.context.Context;
import dmwr.context.gae.ContextProviderGae;
import dmwr.repo.ApplicationRepo;
import dmwr.repo.EntryRepo;
import dmwr.repo.PlayerRepo;
import dmwr.repo.PoolRepo;
import dmwr.repo.ShotRepo;
import dmwr.repo.UserRepo;
import dmwr.repo.gae.ApplicationRepoGae;
import dmwr.repo.gae.EntryRepoGae;
import dmwr.repo.gae.Gae;
import dmwr.repo.gae.PlayerRepoGae;
import dmwr.repo.gae.PoolRepoGae;
import dmwr.repo.gae.ShotRepoGae;
import dmwr.repo.gae.UserRepoGae;
import dmwr.service.Service;
import dmwr.service.ServiceImpl;
import dmwr.util.Executor;
import dmwr.util.Operation;

public class Dmwr {

	private static final ApplicationRepo APPLICATION_REPO;
	private static final UserRepo USER_REPO;
	private static final PlayerRepo PLAYER_REPO;
	private static final PoolRepo POOL_REPO;
	private static final EntryRepo ENTRY_REPO;
	private static final ShotRepo TEST_REPO;
	private static final Executor TRANSACTOR;
	private static final Service SERVICE;
	private static final Operation<Context> CONTEXT_PROVIDER;

	static {
		APPLICATION_REPO = new ApplicationRepoGae();
		USER_REPO = new UserRepoGae();
		PLAYER_REPO = new PlayerRepoGae();
		POOL_REPO = new PoolRepoGae();
		ENTRY_REPO = new EntryRepoGae();
		TEST_REPO = new ShotRepoGae();
		TRANSACTOR = Gae.transactor();
		SERVICE = new ServiceImpl();
		CONTEXT_PROVIDER = new ContextProviderGae();
	}

	public static ApplicationRepo applicationRepo() {
		return APPLICATION_REPO;
	}

	public static UserRepo userRepo() {
		return USER_REPO;
	}

	public static PlayerRepo playerRepo() {
		return PLAYER_REPO;
	}

	public static PoolRepo poolRepo() {
		return POOL_REPO;
	}

	public static EntryRepo entryRepo() {
		return ENTRY_REPO;
	}

	public static ShotRepo shotRepo() {
		return TEST_REPO;
	}

	public static Executor transactor() {
		return TRANSACTOR;
	}

	public static Service service() {
		return SERVICE;
	}

	public static Operation<Context> contextProvider() {
		return CONTEXT_PROVIDER;
	}
}
